package com.seafwg;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;


/**
 * SpringBootServletInitializer: 继承这个类， 才能使用独立tomcat服务器
 * SpringBootServletInitializer 就是原有的 web.xml 文件的替代。使用了嵌入式 Servlet,默
 * 认是不支持 jsp
 */
@SpringBootApplication
public class PackageApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(PackageApplication.class, args);
    }

    /**
     *
     * @param builder
     * @return
     */
    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        // retrun builder.sources(PackageApplication.class);
        return builder.sources(PackageApplication.class);
    }
}
